#!/bin/bash

# login
sudo docker login --username=brucelee188 registry.cn-hangzhou.aliyuncs.com
# 71**Ab

# delete all images
docker rmi  -f `docker images|grep ruoyi`

# build images
cd ruoyi-visual/ruoyi-monitor 
./docker.sh

cd ../../
cd ruoyi-modules/ruoyi-system
./docker.sh

cd ../../
cd ruoyi-modules/ruoyi-job
./docker.sh

cd ../../
cd ruoyi-gateway
./docker.sh

cd ../
cd ruoyi-modules/ruoyi-file
./docker.sh

cd ../../
cd ruoyi-auth
./docker.sh

# push to aliyun
# modify docker tag
docker images|grep ruoyi
docker tag ruoyi-visual-monitor:v1.0 registry.cn-hangzhou.aliyuncs.com/neo_ruoyi/ruoyi-visual-monitor-arm:v2.0
docker tag ruoyi-system:v1.0 registry.cn-hangzhou.aliyuncs.com/neo_ruoyi/ruoyi-system-arm:v2.0
docker tag ruoyi-job:v1.0 registry.cn-hangzhou.aliyuncs.com/neo_ruoyi/ruoyi-job-arm:v2.0
docker tag ruoyi-gateway:v1.0 registry.cn-hangzhou.aliyuncs.com/neo_ruoyi/ruoyi-gateway-arm:v2.0
docker tag ruoyi-file:v1.0 registry.cn-hangzhou.aliyuncs.com/neo_ruoyi/ruoyi-file-arm:v2.0
docker tag ruoyi-auth:v1.0 registry.cn-hangzhou.aliyuncs.com/neo_ruoyi/ruoyi-auth-arm:v2.0

# pull images
docker push registry.cn-hangzhou.aliyuncs.com/neo_ruoyi/ruoyi-visual-monitor-arm:v2.0
docker push registry.cn-hangzhou.aliyuncs.com/neo_ruoyi/ruoyi-system-arm:v2.0
docker push registry.cn-hangzhou.aliyuncs.com/neo_ruoyi/ruoyi-job-arm:v2.0
docker push registry.cn-hangzhou.aliyuncs.com/neo_ruoyi/ruoyi-gateway-arm:v2.0
docker push registry.cn-hangzhou.aliyuncs.com/neo_ruoyi/ruoyi-file-arm:v2.0
docker push registry.cn-hangzhou.aliyuncs.com/neo_ruoyi/ruoyi-auth-arm:v2.0
